home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / Development / RKM_Companion_v2.04 / Keyboard / Keyhandler.a < prev    next >
Encoding:
Text File  |  1999-10-27  |  3.0 KB  |  85 lines

  1. *
  2. * Copyright (c) 1992-1999 Amiga, Inc. 
  3. * This example is provided in electronic form by Amiga, Inc. for 
  4. * use with the "Amiga ROM Kernel Reference Manual: Devices", 3rd Edition, 
  5. * published by Addison-Wesley (ISBN 0-201-56775-X).
  6. * The "Amiga ROM Kernel Reference Manual: Devices" contains additional 
  7. * information on the correct usage of the techniques and operating system 
  8. * functions presented in these examples.  The source and executable code 
  9. * of these examples may only be distributed in free electronic form, via 
  10. * bulletin board or as part of a fully non-commercial and freely 
  11. * redistributable diskette.  Both the source and executable code (including 
  12. * comments) must be included, without modification, in any copy.  This 
  13. * example may not be published in printed form or distributed with any
  14. * commercial product.  However, the programming techniques and support
  15. * routines set forth in these examples may be used in the development
  16. * of original executable software products for Amiga computers.
  17. * All other rights reserved.
  18. * This example is provided "as-is" and is subject to change; no
  19. * warranties are made.  All use is at your own risk. No liability or
  20. * responsibility is assumed.
  21. *
  22. ****************************************************************************
  23. *
  24. *       KeyHandler.a
  25. *
  26. * Keyboard reset handler that signals the task in the structure...
  27. *
  28. *
  29. * See Key_Reset.c for details on how to compile/assemble/link...
  30. *
  31. ************************************************************************
  32. * Required includes...
  33. *
  34. *       CSECT   KeyHandler      ;SAS/Lattice ASM command requires this
  35. *
  36. *       INCDIR  "include:"
  37.  
  38.     section    text,code
  39.  
  40.         INCLUDE "exec/types.i"
  41.         INCLUDE "exec/io.i"
  42.         INCLUDE "devices/keyboard.i"
  43. *
  44.         xref    _AbsExecBase    ; We get this from outside...
  45.         xref    _LVOSignal      ; We get this from outside...
  46. *
  47. ************************************************************************
  48. * Make the entry point external...
  49. *
  50.         xdef    _ResetHandler
  51. *
  52. ************************************************************************
  53. *
  54. * This is the input handler
  55. * The is_Data field is passed to you in a1.
  56. *
  57. * This is the structure that is passed in A1 in this example...
  58. *
  59.         STRUCTURE       MyData,0
  60.         APTR            MyTask
  61.         ULONG           MySignal
  62. *
  63. ************************************************************************
  64. * The handler gets called here...
  65. *
  66. _ResetHandler:  move.l  MySignal(a1),d0 ; Get signal to send
  67.                 move.l  MyTask(a1),a1           ; Get task
  68. *
  69. * Now signal the task...
  70. *
  71.                 move.l  a6,-(sp)        ; Save the stack...
  72.                 move.l  _AbsExecBase,a6 ; Get ExecBase
  73.                 jsr     _LVOSignal(a6)  ; Send the signal
  74.                 move.l  (sp)+,a6        ; Restore A6
  75. *
  76. * Return to let other handlers execute.
  77. *
  78.                 rts                     ; return from handler...
  79. ************************************************************************
  80.                 END
  81.